#!/usr/bin/env python

import meson

def on_message(msg, ident):
    print 'From server:', msg, ident

def main():
    meson.init() # (('127.0.0.1', 10060))
    meson.receive(None, on_message)
    for i in xrange(5):
        msg = 'MSG %d' % i
        meson.send(msg, '10061@127.0.0.1')
        print 'Sent:', msg
    meson.run()

if __name__ == '__main__':
    main()
